<?php
class Geolocation_Model extends CI_Model
{
	var $indicator = true;
	function __construct()
	{
		parent::__construct();
		//$temp = $this->session->userdata('is_logged_in');
		//if(!isset($temp) || !$temp) exit('No direct script access allowed');
	}
	
	function index()
	{
		echo $this->input->get('lat');
		echo $this->input->get('longi');
	}
	
	
	function in()
	{
		$temp = $this->input->get('lat');
		if(!isset($temp)||$temp=='')
			$this->get_current_location();
		else
			echo $this->session->userdata('lat');
		//echo $d['lat'];
		//echo $d['longi'];
	}

	
	function get_current_location()
	{
		$temp = $this->input->get('lat');
		if(!isset($temp)||$temp=='')
			redirect('map-geolocation');
		else 
		{
			$data['lat'] = $temp;
			$data['longi'] = $this->input->get('longi');
			echo 'asd';
			return $data;
			//$this->session->set_userdata($data);
			//$this->in();
		}
	}
	
	function choose_location()
	{
		
	}
}
?>